package com.blank.shop.ssr.controller;

import com.blank.shop.ssr.service.ArticleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <br/>Date 2021/9/6
 * <br/>Time 10:51:42
 *
 * @author _blank
 */
@Slf4j
@RestController
public class ArticleController {

    @Resource
    private ArticleService articleService;

    @GetMapping(path = {"view/{articleId}"})
    public ResponseEntity<String> likeArticle(@PathVariable(name = "articleId") String articleId) {
        String likeFlag = this.articleService.likeArticle(articleId);
        return ResponseEntity.ok(likeFlag);
    }

}
